package com.qzyh.esb.egsa.utils;

import com.qzyh.esb.egsa.bean.dto.ContextDTO;

/**
 * 基于ThreadLocal封装工具类，
 */
public class BaseContextUtil {

    //用于填充的update_user为Long类型
    private static ThreadLocal<ContextDTO> threadLocal = ThreadLocal.withInitial(()->new ContextDTO());

    /**
     * 设置值 用户id
     *
     * @param
     */
    public static void setUserId(String userId) {
        threadLocal.get().setUserId(userId);
    }

    /**
     * 获取值 用户id
     *
     * @return
     */
    public static String getUserId() {
        return threadLocal.get().getUserId();
    }
}
